﻿///***************************************************************
/// 시  스  템 : Updms.Car.Dac
/// 단위시스템 : CAR
/// 계      층 : Data Access Layer
/// 프로그램명 : Car_Dac_UPDMS_CAR_REPORT_Car2013r
/// 파  일  명 : Car_Dac_UPDMS_CAR_REPORT_Car2013r.cs
/// 설      명 : 월간차량비용내역
///***************************************************************
/// 수정ID 일자       이름     내용
///---------------------------------------------------------------
/// CH001  2010-07-12 송시명   최초 작성
///***************************************************************
using System.Data;
using System.Data.SqlClient;
using System.EnterpriseServices;
using System.Reflection;
using System.Runtime.InteropServices;

using SMFramework.Data;

namespace Updms.Car.Dac
{
	[ComVisible(true)]
	[Transaction(TransactionOption.Supported)]
	[JustInTimeActivation(true)]
	public class Car_Dac_UPDMS_CAR_REPORT_Car2013r : Base.AppFramework.DacBase
	{
		public Car_Dac_UPDMS_CAR_REPORT_Car2013r()
		{
		}

		#region NT [GetMonthlyUsingList]

		[AutoComplete]
		public DataSet GetMonthlyUsingList(DataPack lo_dp)
		{
			string ls_curr_method = MethodBase.GetCurrentMethod().DeclaringType.ToString() + " - " + MethodBase.GetCurrentMethod().ToString();
			string strSql1 = "usp_UPDMS_CAR_REPORT_Car2013r_Get_Monthly_Using_List";
			string strSql2 = "usp_UPDMS_CAR_REPORT_Car2013r_Get_Monthly_Cost_Summary";

			SqlParameter[] paramArray = lo_dp.ToSqlParameters();

			//데이터팩 로깅
			//Base.AppFramework.SMEventLog.WriteDataLog(ls_curr_method, lo_dp);

			DataSet ds = new DataSet();

			//월별비용내역
			_agent.Fill(strSql1, "MONTHLY_USING_LIST", ds, paramArray, CommandType.StoredProcedure, ls_curr_method);
			
			//월별비용합계금액
			_agent.Fill(strSql2, "MONTHLY_COST_SUMMARY", ds, paramArray, CommandType.StoredProcedure, ls_curr_method);
			return ds;
		}

		#endregion

		#region NT [GetYearlyUsingList]
		/// <summary>
		/// 연간차량비용내역 - 주유,정비,주차,통행료를 연도별로 출력
		/// </summary>
		/// <param name="lo_dp"></param>
		/// <returns></returns>
		[AutoComplete]
		public DataSet GetYearlyUsingList(DataPack lo_dp)
		{
			string ls_curr_method = MethodBase.GetCurrentMethod().DeclaringType.ToString() + " - " + MethodBase.GetCurrentMethod().ToString();
			string strSql1 = "usp_UPDMS_CAR_REPORT_Car2013r_Get_Yearly_Using_List";
			string strSql2 = "usp_UPDMS_CAR_REPORT_Car2013r_Get_Yearly_Cost_Summary";
			string strSql3 = "usp_UPDMS_CAR_REPORT_Car2013r_Get_Yearly_Cost_List";

			SqlParameter[] paramArray = lo_dp.ToSqlParameters();

			//데이터팩 로깅
			//Base.AppFramework.SMEventLog.WriteDataLog(ls_curr_method, lo_dp);

			DataSet ds = new DataSet();

			//년도별비용내역
			_agent.Fill(strSql1, "YEARLY_USING_LIST", ds, paramArray, CommandType.StoredProcedure, ls_curr_method);

			//년도별비용합계금액
			_agent.Fill(strSql2, "YEARLY_COST_SUMMARY", ds, paramArray, CommandType.StoredProcedure, ls_curr_method);
			
			//계정별,월별합계 + 총계
			_agent.Fill(strSql3, "YEARLY_COST_LIST", ds, paramArray, CommandType.StoredProcedure, ls_curr_method);

			return ds;
		}

		#endregion
	}
}
